package cn.huangsm.advance.oss;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * OSS配置
 *
 * @author huang
 * @PACKAGE_NAME cn.huangsm.advance.oss
 * @PROJECT_NAME advance-code
 * @date 2019/1/15
 */
@Configuration
public class OSSConfig {
    @Autowired
    private OSSProperties ossProperties;
    //@Bean
    public OSS client() {
        return new OSSClientBuilder().build(ossProperties.getEndpoint(), ossProperties.getAccessKeyId(), ossProperties.getAccessKeySecret());
    }
}
